package org.jupiter.blog.api.dto;

import java.io.Serial;
import java.io.Serializable;
import java.util.List;

/**
 * 通用分页查询返回 DTO
 *
 * @param <T>
 * 		列表数据的类型
 */
public class PageResponseDto<T> implements Serializable {

	@Serial
	private static final long serialVersionUID = 1L;

	/**
	 * 当前页数据
	 */
	private List<T> records;

	/**
	 * 总记录数
	 */
	private long total;

	public PageResponseDto() {
	}

	public PageResponseDto(List<T> records, long total) {
		this.records = records;
		this.total = total;
	}

	public List<T> getRecords() {
		return records;
	}

	public void setRecords(List<T> records) {
		this.records = records;
	}

	public long getTotal() {
		return total;
	}

	public void setTotal(long total) {
		this.total = total;
	}

}

